<%--
  Created by IntelliJ IDEA.
  User: 13009
  Date: 2022/4/14
  Time: 15:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" id="favicon" href="${path}/imgs/index/favicon.ico" type="image/x-icon">
<title>美食首页</title>
<!-- 引入bootstrap.css - 开发环境/bootstrap.min.css - 生产环境-->
<link rel="stylesheet" href="${path}/plugins/bootstrap-3.4.1-dist/css/bootstrap.css">
<!-- 引入登录所需要的h+ -->
<link href="${path}/plugins/Hplus/css/font-awesome.css" rel="stylesheet">

<link href="${path}/plugins/Hplus/css/animate.css" rel="stylesheet">
<link href="${path}/plugins/Hplus/css/style.css" rel="stylesheet">
<link rel="stylesheet" href="${path}/css/index/index.css">
</head>
<body>
<%@include file="nav/navbarheader.jsp"%>
<%--保存用户id--%>

<div id="content"></div>
<!-- binner背景图加搜索框 -->
<div class="container-fluid cc">
    <div class="imgAndContent">
        <img src="${path}/imgs/index/binner-bg.jpg" alt="">
        <div class="search-title">
            <h1>找寻您心中最爱的美食</h1>
        </div>

        <div id="formline" class="input-group center-search">
            <input id="search2" type="text" class="form-control search2" placeholder="店铺/美食...">
            <span class="input-group-btn btn2">
                        <svg t="1648374506062" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3014" width="30" height="30">
                            <path d="M909.824 837.12l-209.408-208.896a333.824 333.824 0 1 0-72.192 72.192l208.896 209.408a51.2 51.2 0 1 0 72.704-72.704z m-477.696-174.592a230.4 230.4 0 1 1 230.4-230.4 230.4 230.4 0 0 1-230.4 230.4z" fill="" p-id="3015"></path></svg><!-- <button class="btn btn-default" type="button"><span class="glyphicon glyphicon-search"></span></button> -->
                    </span>
        </div>

        <form action="#" id="search2form" class="search2form">

        </form>
    </div>

</div>
<!-- search结束 -->

<!-- 中间三个格子 -->
<div class="container-fluid midmargin mid">
    <div class="itemc">
        <div class="item">
            <img class="itemimg1" src="${path}/imgs/index/binner_item1.png" alt="">
            <h3>查找精选用餐地点</h3>
            <p>上百万家餐厅——从街头美食到高级餐厅应有尽有</p>
        </div>
        <div class="item">
            <img class="itemimg2" src="${path}/imgs/index/binner_item2.png" alt="">
            <h3>查看最新热评</h3>
            <p>来自各位用户的精彩点评</p>
        </div>
        <div class="item">
            <img class="itemimg3" src="${path}/imgs/index/binner_item3.png" alt="">
            <h3>分享个人体验</h3>
            <p>拥有自己的美食日记</p>
        </div>
    </div>
</div>

<!-- 格子下的内容 -->
<!-- 浏览相关推荐 -->
<div class="container-fluid mid mid1">
    <div><h2>餐厅相关推荐</h2></div>
    <div class="nav_wrap">
        <ul class="nav_mine" id="likes">
<%--            ajax异步加载--%>
        </ul>
    </div>
</div>

<!-- 午餐推荐 -->
<div class="container-fluid mid">
    <h2>苏州市的午餐推荐 <em><a href="${path}/fr/classify">查看更多</a></em></h2>
    <div class="lunchrecm">
        <div class="lunchouter" id="likel">
            <%--            ajax异步加载--%>
        </div>
    </div>
</div>

<!-- 晚餐推荐 -->
<div class="container-fluid mid night">
    <h2>苏州市的晚餐推荐 <em><a href="${path}/fr/classify">查看更多</a></em></h2>
    <div class="lunchrecm">
        <div class="lunchouter" id="liken">
            <%--            ajax异步加载--%>
        </div>
    </div>
</div>

<!-- 底部导航 -->
<%@include file="nav/navbarfooter.jsp"%>
<script src="${path}/plugins/jquery.min.js"></script>
<script src="${path}/plugins/bootstrap-3.4.1-dist/js/bootstrap.js"></script>
<script src="${path}/js/index/login.js"></script>
<script src="${path}/js/index/register.js"></script>
<script src="${path}/js/index/index.js"></script>
<script src="${path}/js/index/recommend.js"></script>
<script>
$(function() {
    $("#search2").bind("keypress",function (event) {
        if (event.keyCode == "13") {
            let str9 = document.getElementById("search2").value;
            window.location.href="/fr/fr/search/"+str9
            window.localStorage.setItem("name",str9)
        }
    })
});
$(function() {
    $("#search1").bind("keypress", function (event) {
        if (event.keyCode == "13") {
            let str11 = document.getElementById("search1").value;
            window.location.href = "/fr/fr/search/" + str11
            window.localStorage.setItem("indexName", str11)
        }
    })
});

$(function () {
    let userIdHid = $("input[name='userIdHid']").val();
    $.ajax({
        type:"post",
        url:"/fr/index/history/"+userIdHid+"",
        success:function (res) {
            let str = "";
            let list = res.data;
            console.log(list);
            let str1 = "<a class=\"btn btn-default\" href=\"/fr/fr/classify\" role=\"button\">\n" +
                "                <div class=\"lefticon\">\n" +
                "                    <svg t=\"1648555895063\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"4083\" width=\"20\" height=\"20\">\n" +
                "                        <path d=\"M599.67 957.12l-2.88-0.09c-21.56-1.08-40.16-16.02-45.97-37.15l-95.93-348.76-350.72-97.78a50.568 50.568 0 0 1-37-46.3 50.613 50.613 0 0 1 32.23-49.73L888.05 70.57c18.69-7.26 39.98-2.8 54.18 11.38 14.23 14.22 18.71 35.5 11.42 54.22L646.89 924.82c-7.51 19.31-26.49 32.3-47.22 32.3zM154.19 422.74l351.32 97.94 96.04 349.16L886.2 138.02 154.19 422.74z\" fill=\"#2c2c2c\" p-id=\"4084\"></path></svg>\n" +
                "                </div>\n" +
                "                <div class=\"lefttext\">\n" +
                "                    苏州地区\n" +
                "                </div>\n" +
                "            </a>\n" +
                "            <hr>\n" +
                "            <div class=\"searchinfo\">浏览记录</div>\n";
            $.each(list,function (index,item) {
                str += "            <a class=\"btn btn-default\" href=\"/fr/storeInfo/enter/"+item.id+"\" onclick=\"writerIndexHistory("+userIdHid+","+item.id+")\" role=\"button\">\n" +
                    "                <div class=\"lefticon\">\n" +
                    "                    <svg t=\"1648556523361\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"5229\" width=\"20\" height=\"20\">\n" +
                    "                        <path d=\"M730.001059 142.376685C674.219615 92.668563 596.796268 65.290005 512 65.290005S349.780385 92.668563 293.998941 142.376685c-67.034742 59.736523-102.464673 150.544715-102.464673 262.620279 0 244.113787 280.928251 530.164708 292.88763 542.222325 7.29208 7.354502 17.22122 11.488659 27.577079 11.488659 10.355859 0 20.284999-4.13518 27.577079-11.488659 11.95938-12.05864 292.88763-298.108538 292.88763-542.222325C832.465732 292.921399 797.035802 202.113207 730.001059 142.376685zM511.967254 862.912162c-26.241664-29.129434-67.722404-77.68429-109.032252-136.26857C315.459718 602.581018 269.222651 491.358891 269.222651 404.996964c0-243.122203 185.824219-262.018575 242.776326-262.018575 225.270627 0 242.776326 200.551642 242.776326 262.018575C754.776326 575.98529 580.826552 786.352485 511.967254 862.912162zM512.00921 232.834906c-85.246523 0-154.60417 70.452585-154.60417 157.056012s69.357648 157.054989 154.60417 157.054989c85.256756 0 154.618497-70.451562 154.618497-157.054989S597.265966 232.834906 512.00921 232.834906zM512.00921 478.968699c-47.768957 0-86.626963-39.95806-86.626963-89.077781s38.858006-89.078805 86.626963-89.078805c47.77305 0 86.641289 39.959084 86.641289 89.078805S559.78226 478.968699 512.00921 478.968699z\" p-id=\"5230\"></path></svg>\n" +
                    "                </div>\n" +
                    "                <div class=\"lefttext\">\n" +
                    "                    "+item.shop_name+"\n" +
                    "                </div>\n" +
                    "            </a>\n" +
                    "            <hr>";
            });
            $("#search1form").html(str1+str);
            $("#search2form").html(str1+str);
        }
    })
})
    function writerIndexHistory(userId,shopId) {
        console.log(userId+"::"+shopId),
            $.ajax({
                type:"post",
                url:"/fr/personal/history/"+userId+"/"+shopId+""
            })
    }
</script>
</body>
</html>
